SHREB 3.00 New and Modified Command Summary

See SHREB.pdf for details on unchanged commands.

These are the changes that I've noticed, there may be others.

Gregory C. Harder 07/2022

===============================================================================
(T)RIANGLE has been removed
===============================================================================
CIRCLE includes parameters to draw ellipsoids and arcs.

(C)IRCLE and (XC)IRCLE

  IF USR HR THEN LPRINT C;XC,YC,XR[,YR,AS,AE]
  IF USR HR THEN LPRINT XC;XC,YC,XR[,YR,AS,AE]

   XC=X Center		;0 TO 255
   YC=Y Center		;0 TO 191
   XR=X Radius		;X radius
 Ellipse optional parameters
   YR=Y Radius 		;Y radius
   AS=Arc Start		;Start of Arc in degrees
   AE=Arc End		;End of Arc in degrees
===============================================================================
(F)ILL an enclosed area with selected pattern

  IF USR HR THEN LPRINT UDG;"A","80 80 80 FF 08 08 08 FF"
  IF USR HR THEN LPRINT F;X,Y,L,"A"

     X=X coord	 	;0 TO 255
     Y=Y coord 		;0 TO 191
     L=Lines,   	;Lines to fill
   "F"=Fill chr		;Previously defined UDG fill chr to use
===============================================================================
(T)RACE command is a mini-drawing utility within the main core

   IF USR HR THEN LPRINT TRACE;X,Y,S
     X=X coord	 	;0 TO 255
     Y=Y coord 		;0 TO 191
     S=Speed	   	;Cursor speed

When in TRACE mode your keyboard is defined as...

     1-Left & Up	2-Right & Up
     3-Right & Down	4-Left & Down
     5-Left		6-Down
     7-Up		8-Right
     D-Draw mode	E-Erase mode
     C-Cursore mode	R-Return

   Notice that the graphic symbols on the direction keys correspond to the move
   direction.
 
   A secondary function of TRACE is that it can be used to locate yourself on 
   the screen.  This is very useful when trying to fill oddly shaped areas. The
   last cursor position is stored in HRES system variable XPYP.

   So on return from TRACE PEEK 16380=Xcoord and PEEK 16381=Ycoord

   For example...

   IF USR HR THEN LPRINT FILL;PEEK 16380,PEEK 16381,200,"D"

   Will FILL the area starting at the last TRACE position with UDG chr "D".
===============================================================================
"Windowing" System
===============================================================================
G$ (G)et window command.

   IF USR HR THEN LPRINT G$;Y,X,A$

     Y=Y PRINT coord 	;0 TO 191
     X=X PRINT coord	;0 to 31
     A$=String Array   	;Save window data to A$

   The number of rows and columns stored is determined by the arrays dimen-
   sions.

   A$(R,C) where R=0 to 191, Pixel rows to save, C=0 to 31, Chr columns to save

   XX10 DIM A$ (95,16)				Room for 95 rows x 16 columns
   XX..
   XX.. Do something
   XX..
   XX50 IF USR HR THEN LPRINT G$;4,0,A$		Store area starting at 4,0 to A$
===============================================================================
P$ (P)rint window command.

   IF USR HR THEN LPRINT P$;X,Y,A$[,OR][,AND][,XOR]

     Y=Y PRINT coord 	;0 TO 191
     X=X PRINT coord	;0 to 31
     A$=String Array   	;Save window data to A$

   The number of rows and columns stored is determined by the arrays dimen-
   sions.

   A$(R,C) where R=0 to 191, Pixel rows to save, C=0 to 31, Chr columns to save

   XX10 DIM A$ (95,16)				Room for 95 rows x 16 columns
   XX..
   XX.. Do something
   XX..
   XX50 IF USR HR THEN LPRINT G$;4,0,A$		Store area starting at 4,0 to A$
   XX..
   XX.. Do something
   XX..
   X100 IF USR HR THEN LPRINT P$;4,0,A$\        Print A$ data starting at 4,0 
        [,OR][,AND][,XOR]			with optional blend style
===============================================================================
S$ (S)wap window data with stored data, this is used to create non-destructive 
   menus and windows.

   IF USR HR THEN LPRINT S$;X,Y,A$

     Y=Y PRINT coord 	;0 TO 191
     X=X PRINT coord	;0 to 31
     A$=String Array   	;Save window data to A$

   The number of rows and columns stored is determined by the arrays dimen-
   sions.

   A$(R,C) where R=0 to 191, Pixel rows to save, C=0 to 31, Chr columns to save

   XX10 DIM A$ (95,16)				Room for 95 rows x 16 columns
   XX..
   XX.. Do something
   XX..
   XX50 IF USR HR THEN LPRINT G$;4,0,A$		Save data starting at 4,0 to A$
   XX..
   XX.. Do something
   XX..
   X100 IF USR HR THEN LPRINT S$;4,0,A$		Swap A$<->with Screen data, for
   XX..						example print a menu and save screen
   XX.. Do something
   XX..
   X200 IF USR HR THEN LPRINT S$;4,0,A$		Swap A$<->with Screen data, now we
   XX..						restore the screen and save the menu
   XX..						back to A$
===============================================================================
APPENDIX 4

REMOVING 64-COLUMN PRINT

The 64-column character patterns (512 bytes) and the 64-column PRINT driver rou-
tine are located in the 2 REM statements. If you will not be needing the
64-column PRINT option, you can delete this line and reduce the length of the 
core by 616 bytes. Simply delete line 2, then LIST 10 and POKE 16419,0. Then, 
to prevent the possibility of accidentally calling the deleted routine (and 
crashing), enter the following POKEs:

POKE 18933,207
POKE 18934,17

This will force an error I report, if you try to PRINT something in 64-column 
mode (mode 4).

APPENDIX 5

DELETING THE F-SAVE ROUTINES

If you won't be using the fast-load package, you can save 430 bytes by removing 
it. These routines are housed in line 1 REM. Simply delete line 1 to remove the 
line, then enter the following POKEs:

POKE 20260,37
POKE 20261,78
POKE 20278,37
POKE 20279,78

These will cause an error I report if you attempt to use the (deleted) LOAD or 
SAVE commands.
===============================================================================
For those interested.

Location of MC routines by Jump Table addresses from disassembly.

Command				Location

Group 1 commands Jump Table	4F1A

LPRINT (E1)			4E44
LLIST  				4C0E
SCROLL 				4B44
LOAD   				50B1
LIST  	 			4BDC
PAUSE	  			4991
PRINT  				49A9
PLOT	 	  		41EB
RUN    				40CB
SAVE   				5014
RAND   				4C24
CLS    				419C
UNPLOT 				41EF
CLEAR  				40D1
RETURN	 			40BF
COPY   				4B8E
START  				4E25
===============================================================================
Group 2 commands Jump Table	4EEB	LPRINT commands

LPRINT X			4E80	Parse "X" commands
LPRINT Address			4B73
LPRINT Binary 			41D9
LPRINT Circle			42E8	SHREB 3 modified with ellipse
LPRINT Draw			4210		
LPRINT Fill 			48E8	SHREB 3 
LPRINT Invert			467C
LPRINT Locate			4B4B
LPRINT Point			4B64
LPRINT Rectangle	  	460E
LPRINT Sprite			4E63
LPRINT Trace			4D7D	SHREB 3, LPRINT Triangle removed
LPRINT UDG			4804
LPRINT Window			4E6D
G$, P$ S$			4E74	SHREB 3, "Windowing" commands
===============================================================================
GROUP 2 Xcommands Jump Table	4E91	LPRINT "X" commands

LPRINT XCircle			42EC
LPRINT XDraw			4214
LPRINT XRect			4612
===============================================================================
SPRITE routines 		4E9B	LPRINT "S" commands

LPRINT SD;n,"hh,hh,...,hh"	4C46	SD=(S)prite (D)efine
LPRINT SE			4CE9	SE=(S)prite (E)rase
LPRINT SM;n,x1,y1,x2,y2		4D07	SM=(S)prite (M)ove
LPRINT SM;n,x2,y2			SM=(S)prite (M)ove
LPRINT SP;n,x,y			4C7D	SP=(S)prite (P)rint
LPRINT SS;			4D48    SS=(S)prite (S)peed Fastest
LPRINT SS;n				SS=(S)prite (S)peed
===============================================================================
;WINDOW scroll routines		4EAC	LPRINT "W" commands
===============================================================================
LPRINT WindowD			44E6
LPRINT WindowL			4529
LPRINT WindowR			4593
LPRINT WindowU			4479
===============================================================================
"Windowing" Routines		4EBA	LPRINT "$" commands
===============================================================================
LPRINT G$			4778 	SHREB 3, Store window data to array
LPRINT P$			471C 	SHREB 3, Print window data from array
LPRINT S$			477C 	SHREB 3, Swap array<->screen data
